package cn.cxf.demo.service.impl;

import cn.cxf.demo.service.ActivitiService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.DeploymentBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: activiti_demo
 * @description: activiti服务实现
 * @author: chenxf
 * @create: 2022-01-18 11:30
 **/
@Service
public class ActivitiServiceImpl implements ActivitiService {
    @Autowired
    private RepositoryService repositoryService;

    @Override
    public void deployment(String file, String pngFile,String name) {
        DeploymentBuilder builder = repositoryService.createDeployment();
        builder.addClasspathResource(file);
        builder.addClasspathResource(pngFile);
        builder.name(name);
        Deployment deployment = builder.deploy();
    }
}
